package com.esun.payment_api.service.impl;

import com.esun.payment_api.dao.DkReceiveDao;
import com.esun.payment_api.domain.DkReceive;
import com.esun.payment_api.dto.DkReceiveQueryParam;
import com.esun.payment_api.mapper.DkReceiveMapper;
import com.esun.payment_api.mapper.DkReceiveProMapper;
import com.esun.payment_api.service.DkReceiveService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DkReceiveServiceImpl implements DkReceiveService {

    @Autowired
    private DkReceiveMapper dkReceiveMapper;

    @Autowired
    private DkReceiveProMapper dkReceiveProMapper;

    @Override
    public List<DkReceiveDao> getList(DkReceiveQueryParam dkReceiveQueryParam, Integer pageSize, Integer pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        if(dkReceiveQueryParam.getCoId() == null){
            dkReceiveQueryParam.setCoId(22);
        }
        return dkReceiveProMapper.getList(dkReceiveQueryParam);
    }

    @Override
    public DkReceiveDao getDkReceiveById(Integer id) {
        return dkReceiveProMapper.getDkReceiveById(id);
    }
}
